package com.example.springbootmybatisplus.bean;

import com.baomidou.mybatisplus.annotation.*;
import com.example.springbootmybatisplus.annotation.SensitiveField;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 
 * @TableName user_info
 */
@TableName(value ="user_info")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserInfo implements Serializable {
    /**
     * 主键ID
     */
    @TableId(type = IdType.AUTO)
    @NotNull(message = "用户id不能为空!")
    private Integer id;

    /**
     * 用户名
     */
    @SensitiveField(SensitiveField.SensitiveTypeEnum.NAME)
    private String userName;

    /**
     * 年龄
     */
    private Integer age;

    /**
     * 来源
     */
    private Integer source;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    /**
     * 创建人
     */
    @TableField(fill = FieldFill.INSERT)
    private String createUser;

    /**
     * 修改时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    /**
     * 修改人
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updateUser;


    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}
